﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" import="java.sql.*"%>
<%@ page import="ookweb.Conn"%>
<%@ include file="public.jsp" %> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/ookweb/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <base href="<%=basePath%>">
    <title>My JSP 'left.jsp' starting page</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script src="<%=basePath%>js/jquery-1.5.1.min.js"  type="text/javascript" ></script>
    <style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background:#d2dfe9;
	color:#097601;
	background-color: #E7F1E3;
}
div{ padding:6px; font-size:12px; font-family:"宋体";}
div dl{ height:22px; line-height:22px; border:1px dotted #7ba1b8;padding:0px;margin:3px;}
div dl a{ color:#097601;text-decoration:none}
div dl a:link {	color: #097601;text-decoration:none}
div dl a:visited {	color: #097601;text-decoration:none}
div dl a:hover {	color: #097601;text-decoration:none}
div dl a:active {	color: #097601;text-decoration:none}
-->
</style>


  </head>
  <body>
    <div>
    <%
    String tid=(String)request.getParameter("tid");
    String mid="1";
    int intT=0;
    String message="";
    if(!("".equals(tid) ||  tid==null)){
     mid=tid;
    }
		Conn con=new Conn(dbuser,dbpass,dburl);
		String sql="";
		sql="SELECT * FROM web_manage_menu a left join web_leftmenu b on a.leftid=b.leftid left join ";
		sql=sql+" web_manage c on a.userid=c.userid left join web_topmenu d on b.menuid=d.menuid ";
		sql=sql+" where d.menuid="+mid+" and a.userid="+session.getAttribute("ookweb_m_userid")+" order by b.sort asc";
		ResultSet rs=con.getRs(sql);
		int i=0;
		while(rs.next()){
		i++;
		out.print("<dl id=\"lb"+i+"\" onclick=\"selleft(this)\">◇<a href=\""+rs.getString("path")+"\" target=\"mainFrame\">"+rs.getString("leftname")+"</a></dl>");
	    }
     con.close();
    %>
   </div> 
   
   <script type="text/javascript">
function selleft(obj){
   for(var i=1;i<=<%=i%>;i++){
    $("#lb"+i).css({"background":"#C8FCB1"});
   }
   $(obj).css({"background":"#97E376"});
}
</script>
  </body>
</html>